package principle.proxy;

/**
 * @author malguy-wang sir
 * @create ---
 */
public class teacherDaoProxy implements ITeacherDao{//静态代理
    private ITeacherDao iTeacherDao;//目标对象，通过接口聚合
    public teacherDaoProxy(ITeacherDao iTeacherDao) { this.iTeacherDao = iTeacherDao; }
    @Override
    public void teach() {
        System.out.println("代理开始");
        iTeacherDao.teach();
        System.out.println("代理结束");
    }
}
